from django.conf.urls.defaults import *
from lbforum import views
from django.contrib.auth.decorators import login_required
from account.views import profile


urlpatterns = patterns('',
    url(r'^$', views.index, name='lbforum_index'),
    url(r'^accounts/$', login_required(profile), name='account_index'),
    url(r'^user/(?P<user_id>\w+)/$', profile, name='user_profile'),
    url(r'^user/$', profile, name='user_profile'),
    #url(r'^forum/(?P<forum_slug>\w+)/(?P<page_no>\d+)/$', views.forum, name='lbforum_forum'),
    #url(r'^forum/(?P<forum_slug>\w+)/$', views.forum, name='lbforum_forum'),
    url(r'^forum/(?P<forum_slug>\w+)/$', views.forum, name='lbforum_forum'),
    #(r'^forum/(?P<forum_slug>\w+)/$', 'views.forum'),
    url(r'^$', views.index, name='lbforum_index'),
    #url('^topic/new/(?P<forum_id>\d+)/$', views.new_post, name='lbforum_new_topic'),    
    url('^topic/new/(?P<forum_id>\w+)/$', views.new_post, name='lbforum_new_topic'),
    url('^topic/(?P<topic_id>\w+)/$', views.topic, name='lbforum_topic'),
    url('^user/(?P<user_id>\w+)/posts/$', views.user_posts, name='lbforum_user_posts'), 
    url('^user/(?P<user_id>\w+)/topics/$', views.user_topics, name='lbforum_user_topics'),
    url('^reply/new/(?P<topic_id>\w+)/$', views.new_post, name='lbforum_new_replay'),
    #url('^post/(?P<post_id>\w+)/$', views.post, name='lbforum_post'),    
    url('^post/(?P<topic_seq>\w+)/(?P<seq_in_topic>\w+)/$', views.post, name='lbforum_post'),
    #url('^post/(?P<post_id>\w+)/edit/$', views.edit_post, name='lbforum_post_edit'),
    url('^post/(?P<topic_seq>\w+)/(?P<seq_in_topic>\w+)/edit/$', views.edit_post, name='lbforum_post_edit'),
    url('^markitup_preview/$', views.markitup_preview, name='markitup_preview'),                  
)

from attachments.views import *
urlpatterns = urlpatterns+patterns('attachments.views',
    url('^ajax_upload/$', 'ajax_upload', name='attachments_ajax_upload'),
    url('^ajax_delete/$', 'ajax_delete', name='attachments_ajax_delete'),
    url('^ajax_change_descn/$', 'ajax_change_descn', name='attachments_ajax_change_descn'),
)
